package Beans;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import DAOJPA.DAOParticiperJPA;
import film.Film;
import film.Participer;
import personne.Personne;

@ManagedBean
@RequestScoped
public class BeanParticipation implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Personne peronne;
	private Film film;
	private Participer participe = new Participer();
	
	
	public List<Participer> getParticipationInvalide()
	{
		return DAOParticiperJPA.getInstance().getParticipationInvalide();
	}
	
	public void validerParticipation()
	{
		this.participe.setValide(0);
		DAOParticiperJPA.getInstance().save(this.participe);
	}
	
	public void supprimerParticipation()
	{
		DAOParticiperJPA.getInstance().deleteQuery(this.participe);
	}
	
	
	public Personne getPeronne() {
		return peronne;
	}
	public void setPeronne(Personne peronne) {
		this.peronne = peronne;
	}
	public Film getFilm() {
		return film;
	}
	public void setFilm(Film film) {
		this.film = film;
	}
	public Participer getParticipe() {
		return participe;
	}
	public void setParticipe(Participer participe) {
		this.participe = participe;
	}

}
